﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Data.SqlClient;
using System.Data;
using ECommerce.DAL;

namespace Entity
{
    public partial class TblDBDLog
    {
        public static TblDBDLog GetTblDBDLogByOrderId(Int32 orderId)
        {

            // Execute SQL Command
            SqlCommand sqlCmd = new SqlCommand();
            AddParameterToSqlCmd(sqlCmd, "@OrderId", SqlDbType.Int, 0, ParameterDirection.Input, orderId);
            SetCommandType(sqlCmd, CommandType.StoredProcedure, "spr_TblDBDLog_GetTblDBDLogByOrderId");
            GenerateCollectionFromReader test = new GenerateCollectionFromReader(GenerateTblDBDLogCollectionFromReader);
            CustomCollection<TblDBDLog> objCollection = ((CustomCollection<TblDBDLog>)ExecuteReaderCmd(sqlCmd, test));

            if (objCollection.Count > 0)
                return objCollection[0];
            else
                return null;
        }
    }
}